#!/bin/bash
from="postmaster@pla.br"
to="ricardo.brito@pla.br"
subject="::logs de backup::"
server="guarani"
body="`cat simplemail.sh`"
date=`LC_ALL=C date "+%a, %d %b %Y %k:%M:%S %z"`
{
    sleep 1
    echo "EHLO $HOSTNAME"
    sleep 1
    echo "MAIL FROM: $from"
    sleep 1
    echo "RCPT TO: $to"
    sleep 1
    echo "DATA"
    sleep 1
    echo "FROM: $from"
    echo "TO: $to"
    echo "SUBJECT: $subject"
    echo "Date: $date"
    echo
    echo "$body"
    echo "."
    sleep 1
    echo "quit"
}  | telnet $server 25 
